#pragma once
#include "init.h"

struct block
{
  int *data;
  long last_used;
};

class cache {
 public:
  cache(int);			
  ~cache();
  void setEnd(bool);
  bool read(int);
  void write(int);
  void updateLRU();
  unsigned int getHits();
  unsigned int getAccesses();
  bool getEnd();
  void write_up(int);
 protected:
  unsigned int totalHits;
  unsigned int totalAccesses;
  int mNumBlocks;
  int *theCache;
  int *lru;
  bool theEnd;
  bool *dirty;
};


